#include <bits/stdc++.h>
using namespace std;
bool is_dig(char c)
{
    return '0' <= c && c <= '9';
}
bool is_cha(char c)
{
    return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
}
bool isPalStr(string chars)
{
    int l = 0, r = chars.size();
    string res;
    for (int i = 0; i < r; ++i)
    {
        if (is_dig(chars[i]))
        {
            res.push_back(chars[i]);
        }
        else if (is_cha(chars[i]))
        {
            res.push_back(tolower(chars[i]));
        }
    }
    string res2;
    for (int i = res.size() - 1; i >= 0; --i)
    {
        res2.push_back(res[i]);
    }
    return res2 == res;
}